﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using FredCK.FCKeditorV2;
using CKEditor.NET;

public partial class ManageIntro : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        SetPropertyFileUpload();
    }
    private void SetPropertyFileUpload()
    {
        FileUpload1.FolderUpload = "Intro";
        Control ctl = DetailsView_Banner.FindControl("txtImage");
        if (ctl != null)
        {
            TextBox txtImageUrl = ctl as TextBox;
            FileUpload1.ObjectControl = txtImageUrl;
        }
    }
    protected void dvwCurrBracnh_ItemCreated(object sender, EventArgs e)
    {
        Control ctl = dvwCurrBracnh.FindControl("txtBody");
        if (ctl != null)
        {
            CKEditorControl txtBody = ctl as CKEditorControl;
            txtBody.Language = "vi";
            CKFinder.FileBrowser _FileBrowser = new CKFinder.FileBrowser();
            _FileBrowser.BasePath = "/ckfinder/";
            _FileBrowser.SetupCKEditor(txtBody);
        }
    }
    protected void DetailsView1_ItemCreated(object sender, EventArgs e)
    {
        Control ctl = dvwCurrBracnh.FindControl("txtBody");
        if (ctl != null)
        {
            CKEditorControl txtBody = ctl as CKEditorControl;
            txtBody.Language = "vi";
            CKFinder.FileBrowser _FileBrowser = new CKFinder.FileBrowser();
            _FileBrowser.BasePath = "/ckfinder/";
            _FileBrowser.SetupCKEditor(txtBody);
        }
    }
}
